const list = [
  './signatureBox/index.js'
]
let i = 0;
for(let i = 0;i < list.length;i++){
  const script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = list[i];
  script.onload = function(){
    if(i === list.length -1){
      initData();
    }
  }
  document.getElementsByTagName('head')[0].appendChild(script);
}
// 执行验证函数
function initData(){
  console.log('a')
  // 验证 signature
  const signatureBox = new SignatureBox(document.getElementById('div'),{},'pc');

  window.getImage = function (){
    let url = signatureBox.getCanvasSignature();
    signatureBox.isCanDraw = false;
    console.log(url);
  }

  window.clearCanvas = function (){
    signatureBox.clearDraw();
    signatureBox.isCanDraw = true;
  }
}